#! /bin/bash

#ENV
basepath=$(cd `dirname $0`; pwd)
echo "base path:${basepath}"

webserverCount=${1:-2}
webapiScript="${basepath}/start-webapi.sh"
echo "************************************************************"
echo "ready to deploy war file to ${webserverCount} web servers"
echo "************************************************************"
source ${webapiScript} ${basepath} ${webserverCount}


nginxScript="${basepath}/start-nginx-api.sh"
echo "************************************************************"
echo "ready to deploy NGINX server for API on port 9001"
echo "************************************************************"
source ${nginxScript} ${basepath} ${webserverCount}

webuiScript="${basepath}/start-webui.sh"
echo "************************************************************"
echo "ready to deploy web ui files to ${webserverCount} nodejs servers"
echo "************************************************************"
source ${webuiScript} ${basepath} ${webserverCount}


nginxScript="${basepath}/start-nginx-ui.sh"
echo "************************************************************"
echo "ready to deploy NGINX server for UI on port 91"
echo "************************************************************"
source ${nginxScript} ${basepath} ${webserverCount}



